package com.yylending.las.common;

import android.text.TextUtils;
import com.google.gson.Gson;
import com.yyfax.common.CLog;
import com.yyfax.infrastructure.secure.Cryptos;
import com.yylending.las.Global;

/**
 * Created by laixj on 2017/5/27.
 * Copyright ©2017 www.yylending.com. All Rights Reserved.
 */

public class AESEntity {

	public String json_a;

	public AESEntity(Object param){
		String jsonString = new Gson().toJson(param);
		CLog.i("LogInterceptor", "aes jsonString-->" + jsonString);
		CLog.i("LogInterceptor", "aes Global.KEY_AES-->" + Global.KEY_AES);
		if(!TextUtils.isEmpty(Global.KEY_AES)){
			json_a = Cryptos.aesEncrypt(jsonString, Global.KEY_AES);
			CLog.i("LogInterceptor", "aes json_a-->" + json_a);
			CLog.i("LogInterceptor", "aes decode-->" + Cryptos.aesDecrypt(json_a, Global.KEY_AES));
		}
	}
}
